from langchain.chains import ConversationChain
from langchain.memory import ConversationBufferWindowMemory
from langchain_openai import ChatOpenAI

model = ChatOpenAI(model="gpt-4o-mini")
conversation_with_memory = ConversationChain(llm=ChatOpenAI(temperature=0),
                                             memory=ConversationBufferWindowMemory(k=2),
                                             verbose=True)
conversation_with_memory.predict(input="你好，我是 Mark")
conversation_with_memory.predict(input="我是一个人工智能爱好者，喜欢通过自媒体传播人工智能知识")
conversation_with_memory.predict(input="如今大模型发展得如火如荼，你能帮我制定一期视频节目的内容大纲吗")
conversation_with_memory.predict(input="你还可以给出更多选项吗")
